I want to search for:
PS1=\\
[ "'$HOSTNAME ]
[ $PWD'" ] "
and replace with something alot simpler, for example,
PS1='[ $PWD ]'
any clues?!?!?!?!?
--
| Lelio Fulgenzi | Le...@SuppServ.CCS.UoGuelph.Ca
| Computing & Communications Services | Le...@Herman.CS.UoGuelph.Ca
| University of Guelph |
| Guelph, Ontario | DISCLAIMER:
| N1G 2W1 | All Ideas are MINE....
| Voice : (519) 824-4120 Ext.8044 | Give Credit
| Fax : (519) 767-1620 | Where Credit Is Due
Lelio> This has got me stumped:
Lelio> I want to search for:
Lelio> PS1=\\
Lelio> [ "'$HOSTNAME ]
Lelio> [ $PWD'" ] "
Lelio> and replace with something alot simpler, for example,
Lelio> PS1='[ $PWD ]'
Lelio> any clues?!?!?!?!?
perl -i.bak -e 'undef $/; $_ = <>; s/PS1=\\\n\[.*\n\[.*/PS1='[ \$PWD ]'/; print' .profile
Use the right tools for the right jobs. Perl isn't *always* the
right solution, but it sure works for things like this.
Just another Perl hacker,
--
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
mer...@ora.com (semi-permanent) mer...@agora.rain.com (for newsreading only)
phrase: "Welcome to Portland, Oregon ... home of the California Raisins!"